<template>
  <div>
    <div align="left">我的位置&gt;&gt;科技项目申报&gt;项目分类列表</div>
    <div id="container">
      <div id="content2">
        <table width="100%" height="41" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="15" height="18" align="left" valign="top">
              <div align="left"></div>
            </td>
            <td width="385" align="left" valign="bottom" class="12">&nbsp;</td>
          </tr>
          <tr>
            <td height="4" colspan="2" align="left" valign="bottom"></td>
          </tr>
          <tr>
            <td height="15" align="left" valign="top">&nbsp;</td>
            <td height="15" align="left" valign="top" class="12">
              <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="20" align="center">
                    <div class="right_proaducts">
                    </div>
                    <div class=padding>
                      <div id=middlebody>
                        <table :data="categories" width="100%" border="0" cellpadding="0" cellspacing="1">
                          <tbody>
                          <tr>
                            <td width="10%" align="middle" valign="center" bgcolor="#fba661">
                              <div align="center">编号ID</div>
                            </td>
                            <td width="40%" align="middle" valign="center" bgcolor="#fba661">
                              <div align="center">分类名称</div>
                            </td>
                            <td width="20%" align="middle" valign="center" bgcolor="#fba661">
                              <div align="center">申报开始时间</div>
                            </td>
                            <td width="20%" align="middle" valign="center" bgcolor="#fba661">
                              <div align="center">申报结束时间</div>
                            </td>
                            <td width="10%" align="middle" valign="center" bgcolor="#fba661">
                              <div align="center">申报</div>
                            </td>
                          </tr>
                          <tr v-for="(cate,index) in categories" :key="index">
                            <td align="middle" valign="center" bgcolor="#f3f3f3">
                              <div align="center">{{ cate.categoryid }}</div>
                            </td>
                            <td align="middle" valign="center" bgcolor="#f3f3f3">
                              <div align="center">{{ cate.categoryname }}</div>
                            </td>
                            <td align="middle" valign="center" bgcolor="#f3f3f3">
                              <div align="center">{{ cate.repStartTime }}</div>
                            </td>
                            <td align="middle" valign="center" bgcolor="#f3f3f3">
                              <div align="center">{{ cate.repStopTime }}</div>
                            </td>
                            <td align="middle" valign="center" bgcolor="#f3f3f3">
                              <div align="center">
<!--                                <a :href=`../unit/applyproject.html?cid=${cate.categoryid}`>申报</a>-->
                                  <router-link :to="{path:'/declare/unit/applyProject',query:{cid:cate.categoryid}}">申报</router-link>
                              </div>
                            </td>
                          </tr>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </td>
                </tr>
              </table>
              <br/>
              <div class="table_wz"></div>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <div id="container">
      <div id="footer">
        <p><a href="http://www.ascenttech.com.cn/" target="_blank">版权所有：北京亚思晟商务科技有限公司 &copy;2004-2008|京ICP备05005681</a>
        </p>
      </div>

    </div>
  </div>
</template>

<script>
export default {
  name: "showProjectcategorys",
  data() {
    return {
      uid: JSON.parse(sessionStorage.getItem("userInfo")).uid || "",
      categories: {}
    }
  },
  mounted() {
    this.getCategoriesList();
  },
  methods: {
    //注销
    logout() {
      sessionStorage.clear();
    },
    getCategoriesList() {
      var _this = this;
      this.$axios({
        url: `http://localhost:8080/api/unit/select/categories/${_this.uid}`,
        method: 'get',
      }).then((res) => {
        // console.log(res);
        if (res.data.code == 200) {
          _this.categories = res.data.data.categories;
        }
      })
    }
  }
}
</script>

<style scoped>
@import "@/assets/css/unit_andreas08(blue).css";
</style>
